/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.sap.entity;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author 2013
 */
@Entity
@Table(name = "instrumentohasindicador", catalog = "sapbd", schema = "")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Instrumentohasindicador.findAll", query = "SELECT i FROM Instrumentohasindicador i"),
    @NamedQuery(name = "Instrumentohasindicador.findById", query = "SELECT i FROM Instrumentohasindicador i WHERE i.id = :id")})
public class Instrumentohasindicador implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 45)
    @Column(name = "id")
    private String id;
    @JoinColumn(name = "instrumento_id", referencedColumnName = "id")
    @ManyToOne(optional = false)
    private Instrumento instrumentoId;
    @JoinColumn(name = "indicador_id", referencedColumnName = "id")
    @ManyToOne(optional = false)
    private Indicador indicadorId;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "instrumentohasindicadorId")
    private List<Numericadocumental> numericadocumentalList;

    public Instrumentohasindicador() {
    }

    public Instrumentohasindicador(String id) {
        this.id = id;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public Instrumento getInstrumentoId() {
        return instrumentoId;
    }

    public void setInstrumentoId(Instrumento instrumentoId) {
        this.instrumentoId = instrumentoId;
    }

    public Indicador getIndicadorId() {
        return indicadorId;
    }

    public void setIndicadorId(Indicador indicadorId) {
        this.indicadorId = indicadorId;
    }

    @XmlTransient
    public List<Numericadocumental> getNumericadocumentalList() {
        return numericadocumentalList;
    }

    public void setNumericadocumentalList(List<Numericadocumental> numericadocumentalList) {
        this.numericadocumentalList = numericadocumentalList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Instrumentohasindicador)) {
            return false;
        }
        Instrumentohasindicador other = (Instrumentohasindicador) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entity.Instrumentohasindicador[ id=" + id + " ]";
    }
    
}
